package org.visionlibrary.image.geomtric.model;

public class Cell2d<T, S, Z extends Comparable<Z>> implements
		Comparable<Cell2d<T, S, Z>> {
	private T firstKey;
	private S secondKey;
	private Z value;

	public Cell2d(T firstKey, S secondKey, Z value) {
		this.firstKey = firstKey;
		this.secondKey = secondKey;
		this.value = value;
	}

	public T getFirstKey() {
		return firstKey;
	}

	public void setFirstKey(T firstKey) {
		this.firstKey = firstKey;
	}

	public S getSecondKey() {
		return secondKey;
	}

	public void setSecondKey(S secondKey) {
		this.secondKey = secondKey;
	}

	public Z getValue() {
		return value;
	}

	public void setValue(Z value) {
		this.value = value;
	}

	@Override
	public int compareTo(Cell2d<T, S, Z> o) {
		return this.value.compareTo(o.value);
	}

	public static Cell2d<Integer, Integer, Integer> packInt(int firstKey,
			int secondKey, int value) {

		return new Cell2d<Integer, Integer, Integer>(new Integer(firstKey),
				new Integer(secondKey), new Integer(value));
	}
}